package com.service.impl;

import com.POJO.Test;
import com.mapper.TestMapper;
import com.service.TestService;
import com.util.MybatisConfig;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TestServiceImpl implements TestService {

    private SqlSession sqlSession;
    private TestMapper testMapper;
    {
        sqlSession = MybatisConfig.getSession();
        testMapper = sqlSession.getMapper(TestMapper.class);
    }


    @Override
    public void test() {
        List<Test> testList = testMapper.getTestList();
        for (Test test: testList)
            System.out.println(test.toString());
    }
}
